#ifndef _DIMAGE_H
#define _DIMAGE_H

//==============================================================================
//
//          DImage - the protocol for classes that implements an image
//
//               Copyright (C) 2007  Dick van Oudheusden
//  
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//==============================================================================
// 
//  $Date: 2008-07-19 12:28:59 $ $Revision: 1.5 $
//
//==============================================================================

//
// The DImage protocol specifies methods that should be implemented by
// classes that act as an image.
//

@protocol DImage

  
//// Font members

//
// Return the height of the image
// 
// @return the height
// 
- (unsigned) height;

//
// Return the width of the image
// 
// @return the width
// 
- (unsigned) width;

//
// Return the bytes per pixel
// 
// @return the number of bytes
// 
- (unsigned) bytesPerPixel;

//
// Return the number of images in the image (interlace)
// 
// @return the images
// 
- (unsigned) images;


//// Image methods

//
// Read the next row of image data for blitting 
// 
// @param data          the image data for the next line (size = _width * _pitch)
//
// @return the number of pixels in the row (or 0 for error)
//
- (unsigned) readRow :(unsigned char *) data;

//
// Set the next row of image data in the png file (format: RGB..)
// 
// @param data          the image data for the next line (size = _width * _bpp)
// @param width         the number of pixels in the row
//
// @return success
//
- (BOOL) writeRow :(unsigned char *) data :(unsigned) width;

@end

#endif

